type AnyObject={[key:string]:never}

function findValueByKey(obj: AnyObject, key: string): string | undefined {
    let val
    function search(obj: AnyObject) {
        for (const k in obj) {
            if (Object.prototype.hasOwnProperty.call(obj, k)) {
                if (k === key) {
                    val=obj[k]
                    return
                }
                if (typeof obj[k] === 'object' && obj[k] !== null) {
                    search(obj[k]);
                }
            }
        }
    }
    search(obj);
    return val;
}
const mp={
    "ret": 0,
    "code": 0,
    "msg": "",
    "data": {
        "creater_is_brand_account": 0,
        "creator_type": 0,
        "certification_type": 0,
        "certification_number": "",
        "certification_name": "",
        "agent_certification_type": 0,
        "agent_certification_number": "",
        "agent_certification_name": "",
        "guardian_certification_type": 0,
        "guardian_certification_number": "",
        "guardian_certification_name": "",
        "org_code": "",
        "org_name": "",
        "nick": "腾讯网友",
        "head": "http://i.gtimg.cn/qqlive/images/20180516/icon120.png",
        "desc": "",
        "phone": "177****7921",
        "slogan": "",
        "location_id": "156,610100",
        "location_cname": "",
        "personal_date_birth": "",
        "personal_gender": 0,
        "creater_app_background_pic": "",
        "brand_official_accounts_QR_code": "",
        "brand_tinyapp_QR_code": "",
        "brand_official_website": "",
        "brand_shop_website": "",
        "isOmUser": false,
        "whitelist": {
            "data_center": true,
            "zhiying": true
        },
        "nick_fake": "西安小火花团队",
        "head_fake": "",
        "desc_fake": "",
        "realname": 0,
        "creative_center_integration_notice": "0",
        "program_production_license_code": "",
        "program_production_license": [],
        "legal_person_id_card_img": [],
        "cooperation_types": [],
        "vcuid": "9001613758",
        "is_merged_account": 0,
        "ever_phone_num": "",
        "need_confirm_external_realname_auth": false,
        "external_realname_auth": "",
        "can_confirm_external_realname_auth": false,
        "external_realname": "",
        "ip_author_type": 2,
        "operator_auth_letter": []
    }
}
const val = findValueByKey(mp,'nick_fake');
console.log(val)
